package com.jfinal.bbsapp.fp;
import com.jfinal.aop.Clear;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.core.Path;
import com.jfinal.bbsapp.common.kit.CommonUtils;
@Path("/fp")
public class FpController extends Controller {
	@Inject
	private FpService srv;
	
	//获取启动图
	@Clear
	public void getwx(){
		renderJson(srv.getwx());
	}
		
	//获取轮转图
	@Clear
	public void bannerlist() {
		renderJson(srv.bannerlist(getPara("bannertype")));
	}
	
	//获取课程分类
	@Clear
	public void courselist() {
		renderJson(srv.courselist());
	}
	
	//获取免费试听课程
	@Clear
	public void freelist() {
		renderJson(srv.freelist());
	}
	
	//更多免费试听课程分页列表
	@Clear
	public void freeplist() {
		int pagecurrent = CommonUtils.getPageNum(getPara("pagecurrent")), pagesize = CommonUtils.getPageSize(getPara("pagesize"));
		renderJson(srv.freeplist(getRequest().getHeader("token"),pagecurrent,pagesize));
	}
}
